﻿namespace Blaze.Editor
{
    using System;
    using UnityEditor;
    using UnityEngine;

    /// <summary>
    /// 常用目录菜单。
    /// </summary>
    public static class FrequentlyUsedPath
    {
        #region 常用目录

        [MenuItem("Blaze/常用目录/Persistent Data", false, BlazeEditorMenu.Priority.Panels + 1)]
        public static void OpenPersistentDataPath()
        {
            ExplorerUtility.Show(Application.persistentDataPath, true);
        }

        [MenuItem("Blaze/常用目录/Streaming Assets", false, BlazeEditorMenu.Priority.Panels + 2)]
        public static void OpenStreamingAssetsPath()
        {
            ExplorerUtility.Show(Application.streamingAssetsPath, true);
        }

        [MenuItem("Blaze/常用目录/Temporary Cache", false, BlazeEditorMenu.Priority.Panels + 3)]
        public static void OpenTemporaryCachePath()
        {
            ExplorerUtility.Show(Application.temporaryCachePath, true);
        }

        [MenuItem("Blaze/常用目录/Application", false, BlazeEditorMenu.Priority.Panels + 100)]
        public static void OpenApplication()
        {
            ExplorerUtility.Show(EditorApplication.applicationPath, false);
        }

        [MenuItem("Blaze/常用目录/Application Contents", false, BlazeEditorMenu.Priority.Panels + 110)]
        public static void OpenApplicationContents()
        {
            ExplorerUtility.Show(EditorApplication.applicationContentsPath, true);
        }

        [MenuItem("Blaze/常用目录/Editor Log", false, BlazeEditorMenu.Priority.Panels + 120)]
        public static void OpenEditorLogPath()
        {
            var path = string.Format(@"{0}\Unity\Editor\Editor.log", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
            ExplorerUtility.Show(path, false);
        }

        #endregion
    }
}